package seu.evaluation.metric;

import java.util.Date;
import java.util.HashMap;

/**
 * 
 * @author samantha
 * 存放解析结果
 * 目前存放：计算可维护性需要的基本元素
 * title:评估报告标题
 * date:评估日期等日志
 * type:评估属性类型
 * finalResult:属性度量结果，整体
 * subResult:键值对，组件id-该组件的属性度量结果
 *
 */

public class MetricResult {

	private String title;
	private Date date; 
	private String type;
	private Object finalResult;
	private HashMap<String,Object> subResult = new HashMap<String,Object> ();
	//private HashMap<Integer,String> componentNameList = new HashMap<Integer,String>();
	
	public MetricResult(){}
	
	public MetricResult(String kindName) {
		type=kindName;
	}
	
	public MetricResult(String kindName,Date d) {
		type=kindName;
		date=d;
	}
	
	public MetricResult(String titleName, String kindName,Date dateValue){
		this.title=titleName;
		this.date=dateValue;
		this.type=kindName;
	}
	
	//set
	
	public void setTitle(String title){
		this.title=title;
	}
	public void setType(String type){
		this.type=type;
	}
	public void setDate(Date date){
		this.date=date;
	}
	public void setFinalResult(Object value){
		this.finalResult=value;
	}
	public void addSubResult(String name, Object value){
		subResult.put(name, value);
	}
	
	//get
	public String getTitle(){
		return this.title;
	}
	public String getType(){
		return this.type;
	}
	public Date getDate(){
		return this.date;
	}
	public Object getFinalResult(){
		return this.finalResult;
	}
	public HashMap<String,Object> getSubResult(){
		return this.subResult;
	}



}
